package main

import (
	"shejiao/app/http/route"
	"shejiao/base"
)

func main() {
	// 初始化配置文件
	base.Config = base.InitConfig("./config.json")

	// 初始化mysql
	mc := base.Config.Mysql
	base.Mysql = base.InitGorm(mc.Ip, mc.Username, mc.Password, mc.Port, mc.DbName)

	// 初始化用户在线匹配管理器
	base.UserMatchManagerRegion = base.InitUserMatchManagerRegion(base.Mysql)

	// 启动http服务
	base.InitHttp(route.InitRoute, base.Config.App.HttpPort)
}
